import requset from '@/utils/request'

// 获取文章分类列表
export const getCategory = () => {
  return requset.get('/my/cate/list')
}

// 添加文章分类
export const userAddCategory = ({ cate_name, cate_alias }) => {
  return requset.post('/my/cate/add', {
    cate_name,
    cate_alias
  })
}

// 删除文章分类
export const userSubCategory = (id) => {
  return requset.delete('/my/cate/del', {
    params: {
      id
    }
  })
}

// 根据id获取文章分类详情
export const getCategoryInfo = (id) => {
  return requset.get('/my/cate/info', {
    params: {
      id
    }
  })
}

// 根据id修改文章分类数据
export const userEditCategory = ({ id, cate_name, cate_alias }) => {
  return requset.put('/my/cate/info', {
    id,
    cate_name,
    cate_alias
  })
}
